package service;

import Shiti.Dingdanti;
import Shiti.Shopti;
import Shiti.Userti;
import dao.DingdanDao;

import java.util.ArrayList;

public class Dingdanservice {
    DingdanDao dingdanDao=new DingdanDao();
    //修改订单
    public boolean change(Userti userti, int num,int id){
        boolean a=dingdanDao.changebus(userti,num,id);
        if (a){
            System.out.println("更改成功");
        }else {
            System.out.println("更改失败");
        }
        return a;
    }
    //添加订单
    public  boolean add(Shopti shopti,Userti userti,int num){
        boolean a=dingdanDao.add(shopti,userti,num);
        if (a){
            System.out.println("添加成功");
        }else {
            System.out.println("添加失败");
        }
        return a;
    }
    //删除订单
    public  boolean dele(Shopti shopti,Userti userti){
        boolean a=dingdanDao.dele(shopti,userti);
        if (a){
            System.out.println("删除成功");
        }else {
            System.out.println("删除失败");
        }
        return a;
    }
    //查看订单
    public ArrayList<Dingdanti>query(Userti userti){
        ArrayList<Dingdanti> list = new ArrayList<Dingdanti>();
        list=dingdanDao.query(userti);
        return  list;
    }
}
